<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var arr = [1];
      arr.length = 4;		  	// 修改数组的长度为4
      console.log(arr);	  	// 输出结果：(4) [1, empty × 3]
      console.log(arr[1]);	// 输出结果：undefined
    </script>
  </body>
</html>